/**     
 * @Title: Message.java   
 * @Package me.xxy.mq   
 * @Description: TODO
 * @author weiwei 
 * @date 2018年6月1日 下午2:25:27   
 * @version V1.0     
 */
package me.xxy.mq;

import java.io.Serializable;

import com.alibaba.fastjson.JSON;

/**
 * @ClassName: Message
 * @Description: TODO
 * @author weiwei
 * @date 2018年6月1日 下午2:25:27
 * 
 */
public class Message implements Serializable {

	private static final long serialVersionUID = -1928958849469490433L;

	/** 频道 **/
	private String channel;

	/** 消息具体内容 **/
	private Object content;

	public Message() {
		super();
	}

	public Message(String channel, Object content) {
		super();
		this.channel = channel;
		this.content = content;
	}

	/**
	 * @return the channel
	 */
	public String getChannel() {
		return channel;
	}

	/**
	 * @param channel
	 *            the channel to set
	 */
	public void setChannel(String channel) {
		this.channel = channel;
	}

	/**
	 * @return the content
	 */
	public Object getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(Object content) {
		this.content = content;
	}

	@Override
	public String toString() {
		return JSON.toJSONString(this);
	}

	public Message parse(String json) {
		return JSON.parseObject(json, Message.class);
	}
}